import java.util.Scanner;
import java.util.Stack;

public class Test {
    public static void reverse(String str){
        char[] arr = str.toCharArray();
        Stack<Character> stack = new Stack<>();
        for (char c : arr) {
            stack.push(c);
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(stack.pop());
        }
        System.out.println();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextLine()){
            String string = scanner.nextLine();
            if(string.equals("end")){
                break;
            }
            reverse(string);
        }
    }
}
